package com.ruoyi.mapper;

import com.ruoyi.entity.po.TPlayer;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * @author chenhainan
 * @since 2024-12-08 17:19
 */
@Mapper
public interface TPlayerMapper {
    int deleteByPrimaryKey(@Param("id") Integer id);

    int insert(@Param("record") TPlayer record);

    int insertSelective(@Param("record") TPlayer record);

    TPlayer selectByPrimaryKey(@Param("id") Integer id);

    int updateByPrimaryKeySelective(@Param("record") TPlayer record);

    int updateByPrimaryKey(@Param("record") TPlayer record);

    int deleteTActivitySwitchByIds(@Param("ids") String[] ids);

    List<TPlayer> selectTActivitySwitchList(@Param("record")TPlayer record);

    @Update("update t_player set status = 2 where id = #{playerId}")
    int eliminatePlayer(@Param("playerId") Integer playerId);

    @Update("update t_player set customize_value = #{customizeValue} where name = #{name} ")
    void updateCustomizeValue(@Param("name") String name,@Param("customizeValue") Double customizeValue);

    @Select("select * from t_player where name = #{playerName} ")
    TPlayer selectByName(@Param("playerName") String playerName);

    @Select("select * from t_player where phone_num = #{phoneNum} ")
    TPlayer selectByPhoneNum(@Param("phoneNum")String phoneNum);
}
